﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Web
{
    public partial class showtopic : System.Web.UI.Page
    {
        int id;
        public study.Model.tb_topic_class cltop = new study.Model.tb_topic_class();
        public study.BLL.tb_topic_class cltopbll = new study.BLL.tb_topic_class();
        study.BLL.tb_topic topbll = new study.BLL.tb_topic();

        protected void Page_Load(object sender, EventArgs e)
        {
            Session["MENU_SELECTED"] = 3;
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] == null)
                    Response.Redirect("topic.aspx");

                id = Convert.ToInt32(Request.QueryString["id"]);
                cltop = cltopbll.GetModel(id);
                if (cltop==null)
                    Response.Redirect("topic.aspx");
                Databind(id);
            }

        }

        protected void Databind(int classid)
        {
            StringBuilder strWhere = new StringBuilder();
            strWhere.AppendFormat("ID like '%{0}%'", classid);
            ListView1.DataSource = topbll.GetList(strWhere.ToString());
            ListView1.DataBind();
        }

    }




}